<template>
	<div>
		<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
			<el-form-item label="订单编号" prop="number">
				<el-input v-model="queryParams.number" placeholder="请输入订单编号" clearable />
			</el-form-item>
			<el-form-item label="记录人" prop="auditor">
				<el-select v-model="queryParams.auditor" placeholder="记录人" clearable>
					<el-option v-for="dict in users" :key="dict.id" :label="dict.name" :value="dict.id" />
				</el-select>
			</el-form-item>
			<el-form-item label="审批人" prop="single">
				<el-select v-model="queryParams.single" placeholder="审核人" clearable>
					<el-option v-for="dict in users" :key="dict.id" :label="dict.name" :value="dict.id" />
				</el-select>
			</el-form-item>
			<el-form-item label="单据状态" prop="productReturnState">
				<el-select v-model="queryParams.productReturnState" placeholder="状态" clearable>
					<el-option v-for="dict in productReturnState" :key="dict.dicDataVal" :label="dict.dicDataLabel"
						:value="dict.dicDataVal" />
				</el-select>
			</el-form-item>
			<el-form-item label="记录时间" prop="createTime">
				<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" style="width: 240px;" v-model="createTime"
					type="datetimerange" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['12:00:00']">
				</el-date-picker>
			</el-form-item>
			<el-form-item label="审核时间">
				<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" style="width: 240px;" v-model="approvalTime"
					type="datetimerange" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['12:00:00']">
				</el-date-picker>
			</el-form-item>
			<el-form-item>
				<el-button type="primary" icon="el-icon-search" size="small" @click="queryAll()">搜索</el-button>
				<el-button icon="el-icon-refresh" size="small" @click="reset()">重置</el-button>
			</el-form-item>
		</el-form>
		<el-button type="success" icon="el-icon-plus" size="mini" @click="addForm">新增审核记录</el-button>
		<el-button type="danger" icon="el-icon-delete" size="mini" :disabled="delClcik" @click="delProRet">删除</el-button>
		<!-- 表单组件 -->
		<el-table ref="multipleTable" :data="dataList" tooltip-effect="dark" style="width: 100%;margin-top:10px" @selection-change="handleSelectionChange">
			<el-table-column type="selection" width="55">
			</el-table-column>
			<el-table-column prop="number" label="订单编号" align="center">
			</el-table-column>
			<el-table-column prop="appealName" label="申诉记录名称" align="center">
			</el-table-column>
			<el-table-column prop="auditor" label="记录人" align="center">
				<template slot-scope="scope">
					<div v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
						<div v-if="scope.row.auditor == item.id">
							{{item.name}}
							</v-if>
						</div>
					</div>
				</template>
			</el-table-column>
			</el-table-column>
			<el-table-column prop="createTime" label="记录时间" align="center">
			</el-table-column>
			<el-table-column prop="productReturnState" label="单据状态" align="center">
				<template slot-scope="scope">
					<div v-for="item in productReturnState" :key="item.dicDataId" :label="item.dicDataLabel"
						:value="item.dicDataVal">
						<div v-if="scope.row.productReturnState == item.dicDataVal">
							{{item.dicDataLabel}}
							</v-if>
						</div>
					</div>
				</template>
			</el-table-column>
			<el-table-column prop="brand" label="操作" align="center" show-overflow-tooltip width="240px">
				<template slot-scope="scope">
					<el-button size="mini" @click="handleCheck(scope.$index,scope.row)">
						查看</el-button>
					<el-button size="mini" @click="handleEdit(scope.$index,scope.row)">
						修改</el-button>
					<el-button size="mini" 
						@click="handleTrack(scope.$index,scope.row)">审核跟踪</el-button>
				</template>
			</el-table-column>
		</el-table>

		<!-- 分页组件 -->
		<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
			:current-page="queryParams.pageNum" :page-sizes="[3, 5, 8, 10]" :page-size="queryParams.pageSize"
			layout="->,total, sizes, prev, pager, next, jumper" :total="queryParams.total">
		</el-pagination>

		<el-dialog :visible.sync="open" width="1200px" append-to-body>
			<el-form ref="form" :model="dataForm" label-width="100px">
				<div v-if="lookOver">
					<el-row>
						<el-col :span="8">
							<div style="text-align: left;">单据编号: {{dataForm.number}}</div>
						</el-col>
						<el-col :span="8">
							<div v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
								<div v-if="dataForm.auditor == item.id" style="text-align: center;">制单人: {{item.name}}
									</v-if>
								</div>
							</div>
						</el-col>

						<el-col :span="8">
							<div style="text-align: right;">制单时间: {{dataForm.createTime}}</div>
						</el-col>
					</el-row>
					<el-divider></el-divider>
				</div>
				<el-row>
					<el-col :span="12">
						<el-form-item label="申诉记录名称" prop="appealName">
							<el-input v-model="dataForm.appealName" :readonly="forbid" placeholder="请输入申诉记录名称" />
						</el-form-item>
					</el-col>
					<el-col :span="12">
						<el-form-item label="申诉来源" prop="appealSource">
							<el-input v-model="dataForm.appealSource" :readonly="forbid" placeholder="请输入申诉来源" />
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="24">
						<el-form-item label="申诉记录描述" prop="appealDescribe">
							<el-input v-model="dataForm.appealDescribe" :readonly="forbid" type="textarea"
								placeholder="请输入内容"></el-input>
						</el-form-item>
					</el-col>
				</el-row>

				<el-row>
					<el-col :span="24">
						<span style="text-align: left;font-size: 20px;font-weight: 500; color: black;">
							申诉详细信息</span>
					</el-col>
				</el-row>
				<el-descriptions class="margin-top" style="margin-top: 20px;margin-bottom: 20px;" title="订单基本资料"
					:column="2" border>
					<template slot="extra">
						<el-button type="primary" size="small" @click="chooseOrder" :disabled="forbid">选择订单</el-button>
					</template>
					<el-descriptions-item label="订单编号:">{{order.orderCode}}</el-descriptions-item>
					<el-descriptions-item label="下单日期:">{{order.orderTime}}</el-descriptions-item>
					<el-descriptions-item label="订单类型:">
						<div v-for="item in dicOrderTypeData" :key="item.dicDataId" :label="item.dicDataLabel"
							:value="item.dicDataVal">
							<div v-if="order.bussinessType == item.dicDataVal">
								{{item.dicDataLabel}}
								</v-if>
							</div>
						</div>
					</el-descriptions-item>
					<el-descriptions-item label="订单动作:">
						<div v-for="item in dicOrderActionData" :key="item.dicDataId" :label="item.dicDataLabel"
							:value="item.dicDataVal">
							<div v-if="order.orderAction == item.dicDataVal">
								{{item.dicDataLabel}}
								</v-if>
							</div>
						</div>
					</el-descriptions-item>
				</el-descriptions>
				<el-descriptions class="margin-top" style="margin-top: 20px;margin-bottom: 20px;" title="收货人资料"
					:column="2" border>
					<el-descriptions-item label="收信人姓名:">{{order.cneeName}}</el-descriptions-item>
					<el-descriptions-item label="会员账号:">{{order.cneeAccount}}</el-descriptions-item>
					<el-descriptions-item label="联系电话:">{{order.cneePhone}}</el-descriptions-item>
					<el-descriptions-item label="联系手机:">{{order.cneeCellphone}}</el-descriptions-item>
					<el-descriptions-item label="邮政编码:">{{order.cneePostalCode}}</el-descriptions-item>
					<el-descriptions-item label="收货地址:">{{order.cneeAddress}}</el-descriptions-item>
					<el-descriptions-item label="配送地区:">{{order.cneeDeliArea}}</el-descriptions-item>
					<el-descriptions-item label="配送方式:">
						<div v-for="item in dicCneeDeliWayData" :key="item.dicDataId" :label="item.dicDataLabel"
							:value="item.dicDataVal">
							<div v-if="order.cneeDeliWay == item.dicDataVal">
								{{item.dicDataLabel}}
								</v-if>
							</div>
						</div>
					</el-descriptions-item>
					<el-descriptions-item label="配送费用:">{{order.cneeDeliFare}}</el-descriptions-item>
					<el-descriptions-item label="支付方式:">
						<div v-for="item in dicNeeDeliMethodData" :key="item.dicDataId" :label="item.dicDataLabel"
							:value="item.dicDataVal">
							<div v-if="order.cneeDeliMethod == item.dicDataVal">
								{{item.dicDataLabel}}
								</v-if>
							</div>
						</div>
					</el-descriptions-item>
					<el-descriptions-item label="自提时间:">{{order.cneePickTime}}</el-descriptions-item>
					<el-descriptions-item label="电子邮箱:">{{order.cneeEmail}}</el-descriptions-item>
					<el-descriptions-item label="汇款人:" :span="2">{{order.remittor}}</el-descriptions-item>
					<el-descriptions-item label="备注:" :span="2">{{order.remark}}</el-descriptions-item>
				</el-descriptions>
				<el-row>
					<el-col :span="6">
						<span style="text-align: left;font-size: 20px;font-weight: 500;color: black;">
							订单商品信息</span>
					</el-col>
					<el-col :span="16">
						<el-radio v-model="dataForm.exchanged" :disabled="forbid" label="退货">退货</el-radio>
						<el-radio v-model="dataForm.exchanged" :disabled="forbid" label="换货">换货</el-radio>
					</el-col>
					<el-col :span="2">
						<div style="text-align: right;">
							<el-button type="primary" size="small" @click="quarryGoods()" :disabled="forbid">选择商品
							</el-button>
						</div>
					</el-col>
				</el-row>
				<table style="width: 100%; border-collapse: collapse;border-color: #d8d8d8;" border="1" cellspacing="0"
					cellpadding="0">
					<tr style="height: 50px;text-align: center;">
						<td>商品串码</td>
						<td>商品编号</td>
						<td>商品名称</td>
						<td>单价</td>
					</tr>
					<tr style="height: 50px;text-align: center;">
						<td></td>
						<td>{{goods.gsCode}}</td>
						<td>{{goods.gsName}}</td>
						<td>{{goods.shopPrice}}</td>
					</tr>
				</table>
				<div v-if="dataForm.exchanged=='换货'" style="margin: 25px 0px 0px;">
					<el-row>
						<el-col :span="24">
							<span style="text-align: left;font-size: 20px;font-weight: 500; color: black;">
								订单退换货商品信息</span>
						</el-col>
					</el-row>
					<table style="width: 100%; border-collapse: collapse;border-color: #d8d8d8;" border="1"
						cellspacing="0" cellpadding="0">
						<tr style="height: 50px;text-align: center;">
							<td>商品串码</td>
							<td>商品编号</td>
							<td>商品名称</td>
							<td>单价</td>
						</tr>
						<tr style="height: 50px;text-align: center;">
							<td></td>
							<td>{{goods.gsCode}}</td>
							<td>{{goods.gsName}}</td>
							<td>{{goods.shopPrice}}</td>
						</tr>
					</table>
				</div>
				<div style="margin: 25px 0px 0px;">
					<el-row>
						<el-col :span="24">
							<span style="text-align:left; margin:30px 0px 0px; font-size: 20px;
						font-weight: 500; color: black;">
								客服答复信息</span>
						</el-col>
					</el-row>
				</div>
				<el-row>
					<el-col :span="8">
						<el-form-item label="客服答复意见" prop="pid">
							<el-input v-model="dataForm.oneReply" :readonly="forbid" type="textarea"
								placeholder="请输入...." />
						</el-form-item>
					</el-col>
					<el-col :span="8">
						<el-form-item label="二次答复意见" prop="pid">
							<el-input v-model="dataForm.twoReply" :readonly="forbid" type="textarea"
								placeholder="请输入...." />
						</el-form-item>
					</el-col>
					<el-col :span="8">
						<el-form-item label="备注" prop="pid">
							<el-input v-model="dataForm.remark" :readonly="forbid" type="textarea"
								placeholder="请输入...." />
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="8">
						<el-form-item label="客服答复时间" prop="pid">
							<el-date-picker :readonly="forbid" style="width: 287px;" v-model="dataForm.oneTime"
								type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期">
							</el-date-picker>
						</el-form-item>
					</el-col>
					<el-col :span="8">
						<el-form-item label="二次答复时间" prop="pid">
							<el-date-picker :readonly="forbid" style="width: 287px;" v-model="dataForm.twoTime"
								type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期">
							</el-date-picker>
						</el-form-item>
					</el-col>
					<el-col :span="8" style="text-align: right;">
						<el-button type="info" @click="holdForm()" :disabled="forbid">暂 存</el-button>
						<el-button type="primary" @click="submitForm()" :disabled="forbid">提 交</el-button>
						<el-button @click="cancel">返 回</el-button>
					</el-col>
				</el-row>
			</el-form>

		</el-dialog>
		<!-- 所有的订单 -->
		<el-dialog :visible.sync="orderOpen" width="800px" append-to-body>
			<el-table ref="multipleTable" :data="orderData" tooltip-effect="dark" style="width: 100%">
				<el-table-column prop="orderCode" label="订单编号" align="center">
				</el-table-column>
				<el-table-column prop="cneeName" label="收货人姓名" align="center">
				</el-table-column>
				<el-table-column prop="cneePhone" label="用户手机号" align="center">
				</el-table-column>
				<el-table-column label="操作" align="center">
					<template slot-scope="scope">
						<el-button size="mini" type="primary" @click="orderChoose(scope.$index,scope.row)">选择
						</el-button>
					</template>
				</el-table-column>
			</el-table>
		</el-dialog>
		<!-- 选择当前订单的商品 -->
		<el-dialog :visible.sync="goodsOpen" width="800px" append-to-body>
			<el-table ref="multipleTable" :data="orderGoods" tooltip-effect="dark" style="width: 100%">
				<el-table-column prop="gsCode" label="商品编号" align="center">
				</el-table-column>
				<el-table-column prop="gsName" label="商品名称" align="center">
				</el-table-column>
				<el-table-column label="操作" align="center">
					<template slot-scope="scope">
						<el-button size="mini" type="primary" @click="goodsChoose(scope.$index,scope.row)">选择
						</el-button>
					</template>
				</el-table-column>
			</el-table>
		</el-dialog>
		<!-- 查看审核跟踪 -->
		<el-dialog :visible.sync="taskOpen" width="800px" append-to-body>
			<el-table ref="multipleTable" :data="taskData" tooltip-effect="dark" style="width: 100%">
				<el-table-column prop="processName" label="流程名称" align="center">
				</el-table-column>
				<el-table-column prop="taskName" label="审批人" align="center">
				</el-table-column>
				<el-table-column prop="taskTime" label="审批开始时间" align="center">
				</el-table-column>
				<el-table-column prop="createTime" label="审批结束时间" align="center">
				</el-table-column>
				<el-table-column prop="taskApproveResult" label="审批状态" align="center">
				</el-table-column>
				<el-table-column prop="taskApproveComment" label="审批备注" align="center">
				</el-table-column>
			</el-table>
		</el-dialog>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				queryParams: {
					number: '',
					auditor: '',
					single: '',
					productReturnState: '',
					createBeginTime: '',
					createEndTime: '',
					updateBeginTime: '',
					updateEndTime: '',
					pageNum: 1,
					pageSize: 10,
					total: 0,
				},

				users: [],
				productReturnState: [],
				//创建时间集
				createTime: [],
				//审批时间集
				approvalTime: [],
				showSearch: true,
				dataList: [],
				chooseAll: [],
				//新增或修改数据
				dataForm: {
					id: '',
					number: '', //编号
					auditor: '', //审核人
					single: '', //制单人
					appealName: '', //申请记录名称
					appealSource: '', //申请来源
					appealDescribe: '', //申诉描述
					exchanged: '退货', //退货或换货
					productReturnState: '', //单据状态
					order: '', //订单
					oldGoods: '', //
					newGoods: '', //新商品,如果是换货需要指定某个商品
					oneReply: '', //客服回复意见
					oneTime: null, //回复时间
					twoReply: '', //二次客服回复意见
					twoTime: null, //二次时间
					remark: '', //备注
					approvalTime: null, //审批时间
				},
				open: false,
				//所有订单信息
				orderData: [],
				//选中的订单信息
				order: {},
				//所有商品信息
				orderGoods: [],
				//选中商品信息
				goods: {},
				//退货或者换货选择器
				orderOpen: false,
				goodsOpen: false,
				taskOpen: false,
				lookOver: false,
				forbid: false,
				delClcik: true,
				dicOrderTypeData: [], //订单类型
				dicNeeDeliMethodData: [], //支付方式
				dicOrderActionData: [], //订单动作
				dicCneeDeliWayData: [], //配送方式
				taskData: [],
			}
		},
		methods: {
			//审核跟踪
			handleTrack(idx, row) {
				this.taskOpen = true;
				axios.get("/verify/tasks/" + row.id).then(resp => {
					if (resp.code == 20000) {
						this.taskData = resp.data;
					} else {
						this.taskData = [];
					}
				})
			},
			//删除
			delProRet() {
				let all = this.chooseAll;
				let numbers = [];
				let i = 0;
				while (i < all.length) {
					numbers.push(all[i].number);
					i++;
				}
				this.delData(numbers);
			},
			//查看
			handleCheck(idx, row) {
				this.lookOver = true;
				this.forbid = true;
				this.dataForm = row;
				this.open = true;
				axios.get("/proReturn/getOrders?orderCode=" + this.dataForm.order).then(resp => {
					if (resp.code == 20000) {
						this.order = resp.data[0];
					} else {
						this.order = {};
					}
				});
				axios.get("/proReturn/getGoodsByCode?code=" + this.dataForm.oldGoods).then(resp => {
					if (resp.data != null || resp.data != undefined) {
						this.goods = resp.data;
					} else {
						this.goods = {};
					}
				});
			},
			//修改按钮
			handleEdit(idx, row) {
				this.lookOver = false;
				this.forbid = false;
				this.dataForm = row;
				if (row.productReturnState == 1) {
					this.$message.error("该申请已通过审核,不支持修改");
				} else if (row.productReturnState == 0) {
					this.$message.error("该申请正在审核,不支持修改");
				} else {
					this.open = true;
					axios.get("/proReturn/getOrders?orderCode=" + this.dataForm.order).then(resp => {
						if (resp.code == 20000) {
							this.order = resp.data[0];
						} else {
							this.order = {};
						}
					});
					axios.get("/proReturn/getGoodsByCode?code=" + this.dataForm.oldGoods).then(resp => {
						if (resp.data != null || resp.data != undefined) {
							this.goods = resp.data;
						} else {
							this.goods = {};
						}
					});
				}
			},
			//查询当前订单的商品
			quarryGoods() {
				let id = this.order.orderCode;
				if (id == null || id == '' || id == undefined) {
					this.$message.error("请先选择订单");
				} else {
					axios.get("/orders/" + id).then(resp => {
						this.orderGoods = resp.data;
					});
					this.goodsOpen = true;
				}

			},
			//选择商品
			goodsChoose(idx, row) {
				this.goodsOpen = false;
				this.goods = row;
				this.dataForm.oldGoods = row.gsCode;
			},
			//查询订单
			chooseOrder() {
				this.orderOpen = true;
				this.quarryOrder();
			},
			//选择订单
			orderChoose(idx, row) {
				this.order = row;
				this.dataForm.order = row.orderCode;
				this.orderOpen = false;
			},
			//添加按钮
			addForm() {
				this.lookOver = false;
				this.forbid = false;
				this.open = true;
				this.dataForm = {
					id: '',
					number: '', //编号
					auditor: '', //审核人
					single: '', //制单人
					appealName: '', //申请记录名称
					appealSource: '', //申请来源
					appealDescribe: '', //申诉描述
					exchanged: '退货', //退货或换货
					productReturnState: '', //单据状态
					order: '', //订单
					oldGoods: '', //
					newGoods: '', //新商品,如果是换货需要指定某个商品
					oneReply: '', //客服回复意见
					oneTime: null, //回复时间
					twoReply: '', //二次客服回复意见
					twoTime: null, //二次时间
					remark: '', //备注
					approvalTime: null, //审批时间
				};
				this.goods = {};
				this.order = {};
			},
			//取消按钮
			cancel() {
				this.open = false;
			},
			//暂存
			holdForm() {
				this.dataForm.productReturnState = 2;
				if (this.dataForm.id == null || this.dataForm.id == '' || this.dataForm.id == undefined) {
					this.add();
				} else {
					this.edit();
				}
			},
			//提交按钮
			submitForm() {
				this.dataForm.productReturnState = 0;
				if (this.dataForm.id == null || this.dataForm.id == '' || this.dataForm.id == undefined) {
					this.add();
				} else {
					this.edit();
				}

			},
			//表格多选函数
			handleSelectionChange(val) {
				this.chooseAll = val;
				if (this.chooseAll.length > 0) {
					this.delClcik = false;
				} else {
					this.delClcik = true;
				}
			},
			//页面改变
			handleCurrentChange(val) {
				this.queryParams.pageNum = val;
				this.quarryAll(this.queryParams);
			},
			//每页数量改变
			handleSizeChange(val) {
				this.queryParams.pageSize = val;
				this.quarryAll(this.queryParams);
			},
			//重置点击函数
			reset() {
				this.queryParams = {
					number: '',
					auditor: '',
					single: '',
					productReturnState: '',
					createBeginTime: '',
					createEndTime: '',
					updateBeginTime: '',
					updateEndTime: '',
					pageNum: 1,
					pageSize: 10,
					total: 0,
				};
				this.createTime = [];
				this.approvalTime = [];
			},
			//搜索点击函数
			queryAll() {
				this.queryParams.createBeginTime = this.createTime[0];
				this.queryParams.createEndTime = this.createTime[1];
				this.queryParams.updateBeginTime = this.approvalTime[0];
				this.queryParams.updateEndTime = this.approvalTime[1];
				this.quarryAll(this.queryParams);
			},
			//s设置表头行的样式
			tableHeaderColor({
				row,
				column,
				rowIndex,
				columnIndex
			}) {
				return 'background-color:#dcdcdc;color:#6b6b6b;font-wight:100;font-size:15px;text-align:center'
			},
			//查询所有
			quarryAll(params) {
				axios.get("proReturn", {
					params: params
				}).then(resp => {
					console.log(resp);
					if (resp.code == 20000) {
						this.dataList = resp.data.list;
						this.queryParams.pageNum = resp.data.pageNum;
						this.queryParams.pageSize = resp.data.pageSize;
						this.queryParams.total = resp.data.total;
					} else {
						this.$message.error(resp.msg);
					}
				})
			},
			//删除函数
			delData(ids) {
				this.$confirm(`此操作将永久删除编号为${ids}的数据, 是否继续?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$axios.delete("/proReturn?ids=" + ids).then(resp => {
						if (resp.code == 20000) {
							this.$message.success(`删除编号为${ids}的数据` + resp.msg);
							this.queryAll();
						} else {
							this.$message.error(`删除编号为${ids}的数据` + resp.msg);
						}
					});
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消删除'
					});
				});
			},
			//修改
			edit() {
				if (this.dataForm.exchanged == '换货') {
					this.dataForm.newGoods = this.goods[0].gsCode;
				}
				this.open = false;
				axios.put("/proReturn", this.dataForm).then(resp => {
					if (resp.code == 20000) {
						this.$message.success(resp.msg);
					} else {
						this.$message.error(resp.msg);
					}
				});
			},
			//新增数据
			add() {
				if (this.dataForm.order == '' || this.dataForm.order == null || this.dataForm.order == undefined) {
					this.$message.error("请选择订单");
				} else if (this.dataForm.oldGoods == '' || this.dataForm.oldGoods == null ||
					this.dataForm.oldGoods == undefined) {
					this.$message.error("请选择商品");
				} else {
					this.dataForm.auditor = localStorage.getItem("userId");
					if (this.dataForm.exchanged == '换货') {
						this.dataForm.newGoods = this.goods.gsCode;
					}
					console.log(this.dataForm);
					this.open = false;
					axios.post("/proReturn", this.dataForm).then(resp => {
						if (resp.code == 20000) {
							this.$message.success(resp.msg);
						} else {
							this.$message.error(resp.msg);
						}
					});
					this.queryAll();
				}

			},
			//所有用户
			getAllUsers() {
				axios.get("/proReturn/getUsers").then(resp => {
					console.log(resp);
					this.users = resp.data;
				});
			},
			//申请状态
			quarryState(params) {
				this.$axios.get("data/" + params).then(resp => {
					console.log(resp);
					this.productReturnState = resp.data;
				})
			},
			//查询所有订单
			quarryOrder() {
				axios.get("/proReturn/getOrders").then(resp => {
					console.log(resp);
					this.orderData = resp.data;
				})
			},
		},
		created() {
			this.$axios.get("/users/dic/order_type").then(resp => {
				this.dicOrderTypeData = resp.data;
			});
			this.$axios.get("/users/dic/cnee_DeliMethod").then(resp => {
				this.dicNeeDeliMethodData = resp.data;
			});
			this.$axios.get("/users/dic/order_action").then(resp => {
				this.dicOrderActionData = resp.data;
			});
			this.$axios.get("/users/dic/cnee_deli_way").then(resp => {
				this.dicCneeDeliWayData = resp.data;
			});
		},
		mounted() {
			this.quarryAll(null);
			this.getAllUsers();
			this.quarryState("review");
		},
	};
</script>

<style>
</style>
